}
protected function setAppliedUpdates( $version, $updates = array() ) {
+ $this->db->clearFlag( DBO_DDLMODE );
if( !$this->canUseNewUpdatelog() ) {
return;
}
$this->db->insert( 'updatelog',
array( 'ul_key' => $key, 'ul_value' => serialize( $updates ) ),
__METHOD__ );
+ $this->db->setFlag( DBO_DDLMODE );
}
/**
* @param $val String [optional] value to insert along with the key
*/
public function insertUpdateRow( $key, $val = null ) {
+ $this->db->clearFlag( DBO_DDLMODE );
$values = array( 'ul_key' => $key );
if( $val && $this->canUseNewUpdatelog() ) {
$values['ul_value'] = $val;
}
$this->db->insert( 'updatelog', $values, __METHOD__, 'IGNORE' );
+ $this->db->setFlag( DBO_DDLMODE );
}
/**
array( 'doFunctions17' ),
array( 'doSchemaUpgrade17' ),
array( 'doInsertPage0' ),
+ array( 'doRemoveNotNullEmptyDefaults' ),
//1.18
array( 'addIndex', 'user', 'i02', 'patch-user_email_index.sql' ),
protected function doSchemaUpgrade17() {
$this->output( "Updating schema to 17 ... " );
// check if iwlinks table exists which was added in 1.17
- if ( $this->db->tableExists( $this->db->tableName( 'iwlinks' ) ) ) {
+ if ( $this->db->tableExists( 'iwlinks' ) ) {
$this->output( "schema seem to be up to date.\n" );
return;
}
$this->output( "ok\n" );
}
+ /**
+ * Remove DEFAULT '' NOT NULL constraints from fields as '' is internally
+ * converted to NULL in Oracle
+ */
+ protected function doRemoveNotNullEmptyDefaults() {
+ $this->output( "Removing not null empty constraints ... " );
+ $meta = $this->db->fieldInfo( 'categorylinks' , 'cl_sortkey_prefix' );
+ if ( $meta->isNullable() ) {
+ $this->output( "constraints seem to be removed\n" );
+ return;
+ }
+ $this->applyPatch( 'patch_remove_not_null_empty_defs.sql', false );
+ $this->output( "ok\n" );
+ }
/**
* rebuilding of the function that duplicates tables for tests
-- Create a dummy user to satisfy fk contraints especially with revisions
INSERT INTO &mw_prefix.mwuser
- VALUES (user_user_id_seq.nextval,'Anonymous','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, '', current_timestamp, current_timestamp, 0);
+ VALUES (user_user_id_seq.nextval,'Anonymous',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, '', current_timestamp, current_timestamp, 0);
CREATE TABLE &mw_prefix.user_groups (
ug_user NUMBER DEFAULT 0 NOT NULL,
cl_from NUMBER NOT NULL,
cl_to VARCHAR2(255) NOT NULL,
cl_sortkey VARCHAR2(230),
- cl_sortkey_prefix VARCHAR2(255) DEFAULT '' NOT NULL,
+ cl_sortkey_prefix VARCHAR2(255),
cl_timestamp TIMESTAMP(6) WITH TIME ZONE NOT NULL,
- cl_collation VARCHAR2(32) DEFAULT '' NOT NULL,
+ cl_collation VARCHAR2(32),
cl_type VARCHAR2(6) DEFAULT 'page' NOT NULL
);
ALTER TABLE &mw_prefix.categorylinks ADD CONSTRAINT &mw_prefix.categorylinks_fk1 FOREIGN KEY (cl_from) REFERENCES &mw_prefix.page(page_id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED;
CREATE TABLE &mw_prefix.iwlinks (
iwl_from NUMBER DEFAULT 0 NOT NULL,
- iwl_prefix VARCHAR2(20) DEFAULT '' NOT NULL,
- iwl_title VARCHAR2(255) DEFAULT '' NOT NULL
+ iwl_prefix VARCHAR2(20),
+ iwl_title VARCHAR2(255)
);
CREATE UNIQUE INDEX &mw_prefix.iwlinks_ui01 ON &mw_prefix.iwlinks (iwl_from, iwl_prefix, iwl_title);
CREATE UNIQUE INDEX &mw_prefix.iwlinks_ui02 ON &mw_prefix.iwlinks (iwl_prefix, iwl_title, iwl_from);
CREATE TABLE &mw_prefix.searchindex (
si_page NUMBER NOT NULL,
- si_title VARCHAR2(255) DEFAULT '' NOT NULL,
+ si_title VARCHAR2(255),
si_text CLOB NOT NULL
);
CREATE UNIQUE INDEX &mw_prefix.searchindex_u01 ON &mw_prefix.searchindex (si_page);
qcc_type VARCHAR2(32) NOT NULL,
qcc_value NUMBER DEFAULT 0 NOT NULL,
qcc_namespace NUMBER DEFAULT 0 NOT NULL,
- qcc_title VARCHAR2(255) DEFAULT '' NOT NULL,
+ qcc_title VARCHAR2(255),
qcc_namespacetwo NUMBER DEFAULT 0 NOT NULL,
- qcc_titletwo VARCHAR2(255) DEFAULT '' NOT NULL
+ qcc_titletwo VARCHAR2(255)
);
CREATE INDEX &mw_prefix.querycachetwo_i01 ON &mw_prefix.querycachetwo (qcc_type,qcc_value);
CREATE INDEX &mw_prefix.querycachetwo_i02 ON &mw_prefix.querycachetwo (qcc_type,qcc_namespace,qcc_title);